Posted by: VaRa | July 14, 2009

Liferay Integrating with Alfresco

Integrating with Alfresco

Liferay provides the ability to fully integrate with Alfresco to take care of Users, Communities and Permissions synchronization so that Users can see Alfresco as a Liferay CMS and use it through Liferay portlets. These portlets include Alfresco Client and Alfresco Content.

Important Alfresco is the leading open source for enterprise content management. The open source model allows Alfresco to employ best-of-breed open source technologies and contributions from the open source. URL: http://www.alfresco.com/

Using Alfresco Web Client

You can use Alfresco Web Client as a portlet in Liferay. That is, you use Alfresco content management system inside Liferay. The following figure shows Alfresco Client as a portlet in Liferay.

Image from book

Liferay provides the ability to allow the publication of Alfresco contents through the portal. You can find Alfresco Client from the Liferay official web site, which provides an Alfresco package prepared for deployment:

  1. Download the Alfresco Web Client war file. Rename the file as alfresco.war.
  2. Increase the maximum memory. Edit to increase the memory size:
    SET JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=128m -
    Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.
    login.config=$CATALINA_HOME/conf/jaas.config"
  3. Startup Tomcat. Log in as the administrator.
  4. In the Plugin Installer portlet, click on the Upload tab.
  5. Click Browse, and locate the alfresco.war file.
  6. Click Deploy.
  7. You can now add the Alfresco Client to your page.

Using Alfresco Content

Alfresco web services support remote access and bindings to any client environment. Web Services—SOA is recognized as a way forward for integrating disparate systems including Content Management and building new enterprise-wide solutions. Furthermore, Alfresco Web Scripts are ideal for building data access and updating APIs, simple UI components such as portlets, and integration adaptors. Alfresco OpenSearch has been hosted as a series of Web Scripts. Within Liferay SOA framework, we can export Alfresco content in portlets via Web Services or Web Scripts.

Enjoy Web Services

Web services are applications designed to support interoperable interaction over a network. In fact, web services are just Web APIs accessed over a network, such as the Internet, and executed on a remote system that hosts the requested services.

Alfresco Web Services is provided by Alfresco Repository. It supports remote access and bindings to any client environment. For example, alfresco community is already using PHP, Ruby and Microsoft .NET. Numerous standards and integration efforts are focused around Web Services—SOA is recognized as a way forward for integrating disparate systems including Content Management and building new enterprise-wide solutions. BPEL (Business Process Execution Language) plays an important role in orchestrating all these services.

Alfresco web services API include the following core Services:

  • Authentication
  • Repository—query and model manipulation
  • Content—content manipulation
  • Authoring—collaborative content creation
  • Access Control—Users, groups, Roles and Permissions
  • Administration—environment, configuration, export and import
  • Dictionary—model descriptions
  • Content Rules—automate content management behavior
  • Classification—apply classifications and categories

The following figure depicts an example for Alfresco Content—web services portlet. You can navigate contents, search contents by OpenSearch, and set up default access account. After selecting the content, the portlet will display the content directly in the Portal.

Image from book

Employ Web Scripts

A Web Script provides a service on the web, where the service may perform any function. Web Scripts are suited for Content Management functions, as they are backed by the Alfresco Repository. Each Web Script is bound to a HTTP method and custom URL such as http://sesame.cignex.com/cms_services/services?action=navigate. A library of URLs may be built up to provide a complete (RESTful) HTTP API (for example, to download an image: http://sesame.cignex.com/cms_services/services?action=download&uid=01232bda-f934-11dc-aef1-813a1994e4b0).

Web Scripts allow us:

  • to build custom URL-identified and HTTP accessible Content Management Web Services
  • to turn your Alfresco Repository into a Content Management powered HTTP Server
  • to easily access, manage and cross-link your content via a tailored RESTful API

The following figure depicts an example of the Alfresco ContentWeb Scripts portlet. You can first navigate the contents dynamically by browse tree. After selecting content from the contents list, the portlet will display the content with its own format intelligently. For example, if content format is HTML, the portlet will display the content by HTML. If content format is PDF, the portlet will allow the User to download the content first, and then use local reader to open the content. Then, you can search the contents by keywords.

Finally, you can configure the Alfresco server connection, such as Server URL, Default Account for connection, and so on.

Image from book

Use Alfresco as Liferay Direct Repository

Liferay has a wide range of portlets available freely for things such as Blogs, Calendar, Document Library, Image Gallery, Mail, Message Boards, Polls, RSS Feeds, Wiki, and many others. Liferay Portal also ships with Liferay Journal CMS (Content Management System), which provides basic ECMS (Enterprise Content Management Systems) features. If you want something beefier, then it will integrate with Alfresco.

When you integrate Alfresco with Liferay, you may need to consider the following questions:

  • Do you want to integrate Alfresco Contents within Liferay articles?
  • Do you want to use Alfresco document management as CMS repository of Liferay?
  • Do you want to replace CMS in Liferay with Alfresco CMS in Liferay?

Here is a possible solution:

Image from book

Let’s use alfresco repository for Liferay repository as follows:

  1. Add the Journal portlet in the current page.
  2. Click the Add Article button.
  3. In the editor, click the Insert Image icon next to the Source button and the Insert Anchor icon as shown in the following figure.
  4. In the Image Properties windows, click the Browse Server button.
  5. In the Resources Browser windows, you can browse folders (that is spaces in alfresco) and select files (such as image files) as shown in the following figure.
Image from book

How does it work? Here are possible steps abstracted from the real website:

  • Prepare web scripts in Alfresco server, such as search contents, update contents, get contents, download contents, and navigate spaces as folders.
  • Prepare CMS services for searching contents, updating contents’ metadata, getting contents’ metadata, downloading contents and navigating spaces.
  • In the editor, consume the CMS services replacing the Liferay Image Gallery services and Document Library services.

For example, you can get the bundled files and read-me messages from the web site http://liferay.cignex.com/sesame/ and furthermore, you can play with it as a do-it-yourselfer.

Migrating Contents

Suppose that you already have contents stored in Liferay such as Image Gallery and Document Library. Now, you want to transfer these contents stored in Liferay into Alfresco. Let’s do it as follows.

A portlet called Alfresco Importer provides services of content migration from Liferay Content Management repositories to alfresco repositories. Through Liferay services, the portlet gets all CMS contents with all communities; again by web services, the portlet writes all CMS contents into Alfresco repository, where the space names are created automatically by community’s names. The following figure depicts the look and feel of the Alfresco Importer portlet.

You need to fill the following fields in the Alfresco Importer portlet:

  1. Alfresco username and password: these fields will be used to connect to Alfresco through web services.
  2. Destination path: this is the path of the Alfresco space in which the folders will be created, and the files imported. “Company Home” is the default root space.
  3. You need to specify the folders‘ name that will be created for each CMS portlet. Then, three folders (“spaces” in alfresco terminology) will be created in Alfresco repository: one each for Document Library, Journal Articles and Image Gallery.

After you click on the Import button, the portlet will do the following steps:

  • For each community in the current company, create a space in the root space (described in the second bullet step above). Each space’s name will be the same as the community’s name.
  • Inside each community’s space, create three folders with the names chosen (in third bullet step above).
  • Import the files from Document Library and Image Gallery, keeping the same folder structure they have in these portlets. Journal Articles are imported to the same Folder, their content is merged with their Templates and the result is imported to Alfresco as HTML files.
Important Note that when importing contents from CMS in Liferay to Alfresco repository, links, images, CSS, and JavaScript references in HTML generated article may not resolve correctly.

Image from book

Integrating Liferay with LDAP, SSO And Alfresco

The following diagram shows full integration of Liferay, Alfresco, LDAP and SSO CAS. Here is a generic solution for full integration of SSO CAS and LDAP against Liferay Portal and Alfresco Portlets. Here is the generic solution of SSO CAS plus LDAP against:

  • Alfresco Standalone Application—shown as SSO 1.
  • Liferay Portal and, furthermore, Alfresco Portlets – shown as SSO 2, SSO 3, and SSO 4“.

To integrate SSO CAS plus LDAP with Liferay Portal and Alfresco Portlets such as Alfresco Client portlet and Alfresco Content portlet, simply follow these steps in sequence:

  1. First configure the Liferay Portal authenticating with LDAP.
  2. Then configure the SSO CAS server authenticating with LDAP.
  3. Finally configure the Alfresco portlets (Alfresco Client and Alfresco Content) authenticating with SSO.
Image from book

For example, you can first log in to Alfresco standalone application http://liferay.cignex.com:8090/alfesco by a User account. You are asked to input authentication information here. You will see Alfresco web client standalone application. Then, click Liferay portal http://liferay.cignex.com:8092/c/portal/login. You will see that you don’t have to log in to the Liferay portal. You are logged into the Alfresco Web Client portlet automatically. That is, web applications (Alfresco standalone application, Liferay Portal and portlets) share the same access ticket— to defer all authentications to a trusted central server (SSO and LDAP).

The full integration involves two main functionalities: filters in action for Liferay Portal and Alfresco applications, and portlets in action for any portlet in Liferay Portal. The following are some general instructions to implement these two main functionalities: filters in action and portlets in action.

Filters in action involve the following steps:

  • Enhanced SSO Filter
  • Authenticating SSO CAS Server with LDAP
  • Enhanced validating URL in SSO CAS Server
  • Authenticating with LDAP
  • Automatic login

Portlets in action involve the following steps:

  • Loading portlet
  • Tracing current User from filter
  • Authenticating portlet with LDAP
  • Automatic login

Important URLs for Integration with Alfresco:

1)            Enterprise Security and Authentication Configuration

http://wiki.alfresco.com/wiki/Enterprise_Security_and_Authentication_Configuration

2)               There is a pre-configured alfresco.war in Liferay’s plug-in repository, which you can deploy in the portal.

https://lportal.svn.sourceforge.net/svnroot/lportal/plugins/trunk/


Responses

  1. V@ra – this is a great summary. I appreciate you posting it out there for all users of Alfresco and Liferay.

    However, is there any chance you can provide a link to download the Alfresco Importer portlet? I have not been able to find this portlet.

    Thanks again – Mark

  2. Without Alfresco integration can read contents of folders and display in some portlet.
    I want to read text files in folder and display in liferay portlet.

    • where are the text files, are they in Alfresco ? if Yes, integration is must.

  3. Hi VaRa,

    It is great that you have listed all the techniques of integrating Alfresco with Liferay.

    I have integrated Alfresco as a Web Client in Liferay, but that does not solve my requirement.

    Using Alfresco as Liferay Direct Repository will solve my requirement. But i am not able to integrate it.

    It will be great help, if you can please explain a little more on how to use Alfresco as Liferay Direct Repository.

    Thanks in advance.

    Girish.

  4. Hi,

    Thanks lot for your detailed description. I also need to add the Alfresco portlets to Liferay. I’m using liferay-portal-tomcat-6.0-5.2.3 and liferay-portal-alfresco-4.2.1.war file.

    I renamed liferay-portal-alfresco-4.2.1.war to alfresco.war and uploaded to Liferay. In add application menu it shows Alfresco client and Alfresco content portlet. But when I add these portlets Alfresco Client is working fine and Alfresco content portlet says “Please contact the administrator to setup this portlet. If you are the administrator, go to the configuration screen to setup this portlet”. But when I click the configuration icon it shows a blank area.

    So can you please help me on configuring the Alfresco content portlet or finding a working Alfresco portlet. From where I can download the alfresco content portlet.war file?

    Thanks.

    • Hey ,

      Please let me know , Have you still waiting for portlet.war file ?

      • Hi VaRa

        Yes. I’m still searching for working Alfresco content portlet. I went thorough lot of ways but still not successfull. Your blog is the only one I saw images of working Alfresco content portlet. So I think you have the working copy of it. Although Alfresco client portlet is working, I was unable to find working Alfresco content portlet with Liferay 5.2.3.
        Can you please let me know where I can download that portlet or can you please be kind enough to mail it to me. It would be a great help for me.
        E-mail: piyumali06@gmail.com

        Thank You

    • Sorry for delay,

      Are you still looking for alfresco content portlet.war file ?

      • Hi

        Yes, I’m still looking for a solution to that problem…No success yet.

      • Hi

        Download Liferay 6.x , install and start the server..
        Login with Admin and Click on the ‘Add application’, there is a link called ‘Install More Applications’ , click on it then you will get Plugin Instller Tab, search for ‘Alfresco content portlet’.

        thats it..

        ..Have a Good day
        Vara

  5. Articles are created to express different body of knowledge. That is why I admire writers who are passionate of doing such incredible job. I salute you guys. By the way, I like you post for it is specifically talk about current issues and technicalities in life. I look forward for your subsequent post.I look forward for your next article.Thanks Marks Liferay Development

  6. hi vara ……….pls tell me how to integrate liferay with alfresco using webservices

    • Hi Vasudha,

      Could you please elaborate your exact requirement. So that, I can help you.

      Thanks

  7. Great contents,
    Liferay is collection of components and very helpful for development,
    improved knowledge of integrate with Alfresco in liferay after refer this post.

  8. “Liferay Integrating with Alfresco | Know about Technology” Hunter Douglas seriously causes me personally
    contemplate a tiny bit more. I appreciated
    every single portion of this post. Thanks for your time ,Betty

  9. Great post. I was checking constantly this weblog and I am impressed!

    Extremely helpful information specially the final part 🙂 I handle such
    info much. I used to be seeking this certain info for
    a very long time. Thank you and best of luck.


Leave a comment

Categories